#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=1e6+5;

void solve(int n){
    string s=to_string(n);
    int l=0,r=s.size()-1;
    while(l<=r){
        if(s[l]!=s[r])return;
        l++;
        r--;
    }
    cout<<n<<endl;
    return;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin>>n;
    for (int i = 1; i <= n; i++) {
        solve(i);
    }

    return 0;
}